package com.ruoyi.framework.security.context

import org.springframework.security.core.Authentication

/**
 * 身份验证信息
 *
 * @author ruoyi
 */
object AuthenticationContextHolder {
    private val contextHolder = ThreadLocal<Authentication>()
    @JvmStatic
    var context: Authentication
        get() = contextHolder.get()
        set(context) {
            contextHolder.set(context)
        }

    @JvmStatic
    fun clearContext() {
        contextHolder.remove()
    }
}
